package cn.ruituo.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author <作者>
 * @since <版本>
 */
public class MainServer {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(10);
        try {
            ServerSocket st=new ServerSocket(8888);
            while(true){
                final Socket accept = st.accept();
                executorService.submit(new ServerThread(accept));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
